package com.sale.system.service;

import com.sale.common.mybatis.core.page.PageQuery;
import com.sale.common.mybatis.core.page.TableDataInfo;
import com.sale.system.api.domain.dto.SysCustomerBalance;
import com.sale.system.api.domain.dto.SysCustomerManagementResultDto;
import com.sale.system.domain.SysCustomerManagement;
import com.sale.system.domain.dto.SysCustomerManagementDto;
import com.sale.system.domain.vo.SysCustomerManagementVo;
import com.sale.system.domain.vo.OrderReviewVo;
import com.sale.system.export.CustomerManagementExport;
import com.sale.system.export.CustomerManagementimportExport;

import java.util.List;

/**
 * 客户service
 */
public interface SysCustomerManagementService {

    /**
     * 客户列表
     * @param sysCustomerManagementVo
     * @return
     */
    TableDataInfo<SysCustomerManagementDto> getList(SysCustomerManagementVo sysCustomerManagementVo, PageQuery pageQuery);


    /**
     * 新增客户
     */
    boolean addConverter(SysCustomerManagementVo sysCustomerManagementVo) throws Exception;

    /**
     * 冻结客户
     */
    boolean frozenSupplier(Long id);

    /**
     * 解冻客户
     */
    boolean thawSupplier(Long id);

    /**
     * 撤销审核
     */
    boolean revokeApproval(Long id);

    /**
     * 客户信息导出
     */
    List<CustomerManagementExport> getInfoExport(SysCustomerManagementVo sysCustomerManagementVo);

    /**
     * 导入
     */
    String importMouldData(List<CustomerManagementimportExport> coCustomer);

    /**
     * 查看客户信息
     */
    SysCustomerManagementDto getCustomerById(Long id);

    /**
     * 删除客户
     */
    boolean getDeleteByIds(String ids) throws Exception;

    /**
     * 提交审核
     */
    boolean reivewSubmit(Long id);

    /**
     * 修改客户
     */
    boolean updateCustomerById(SysCustomerManagementVo sysCustomerManagementVo) throws Exception;

    /**
     * 客户审核
     */
    boolean customerReview(OrderReviewVo orderReviewVo) throws Exception;

    /**
     * 客户id
     * @param customerName
     * @return
     */
    SysCustomerManagement getCustomerId(String customerName);

    /**
     * 修改客户启用状态
     */
    boolean updateStatus(SysCustomerManagementVo sysCustomerManagementVo);

    /**
     * 获取启用状态客户列表
     */
    List<SysCustomerManagementDto> getOpenCustomer();

    /**
     * 根据客户编码获取客户信息
     */
    SysCustomerManagementResultDto getCustomerByCode(String customerCode);

    /**
     * 通过客户名称获取客户编码(财务模块使用)
     */
    String getCodeByCustomerName(String customerName);

    /**
     * 通过客户编码更新余额
     */
    boolean updateClientBalance(SysCustomerBalance customerBalance);
}
